import request from '@/utils/request'

// 广告区域
// start
export interface BigPromotionModule {
  floorList: FloorList[]
}
export interface FloorList {
  cells: Cells[]
  taskId: number | string
}
export interface Cells {
  id: string
  itemList: ItemList[]
  picUrl: string
}
export interface ItemList {
  colorNum: 0
  id: number | string
  picUrl: string //盒子里的小图
}
// 类目热销榜
export interface CategoryHotSellModule {
  title: string
  categoryList: CategoryList[]
}
export interface CategoryList {
  categoryName: string
  picUrl: string
}
// 焦点图(数组对象)
export interface FocusList {
  id: number
  picUrl: string
}
// 新人专享礼(右侧)
export interface IndexActivityModule {
  activityPrice: string //活动价
  originPrice: string //原价
  subTitle: string //今日特价
  title: string
  picUrl: string
  showPicUrl: string
  tag: string
}

// 分类
export interface KingKongModule {
  kingKongList: KingKongList[]
}
export interface KingKongList {
  picUrl: string
  schemeUrl: string
  text: string
}
// icon
export interface PolicyDescList {
  desc: string
  icon: string
}

//首页数据
export interface IndexDataList {
  bigPromotionModule: BigPromotionModule
  categoryHotSellModule: CategoryHotSellModule
  focusList: FocusList[]
  indexActivityModule: IndexActivityModule[]
  kingKongModule: KingKongModule
  policyDescList: PolicyDescList[]
  sceneLightShoppingGuideModule: any[],
  freshmanFlag:boolean
  tagList:any[],
  popularItemList: any[],
}



// 首页数据接口
export type IndexData = {
  data:IndexDataList,
  noticeList:any[]
}


export default {
  // 获取首页数据
  getIndexData() {
    return request.get<any, IndexData>('/xhr/index.json?__timestamp=1630131808529')
    // __timestamp=1630131808529
  }
}

// ------------------------------ res.data.data.tagList ------------------------------ 
// interface ResDataType<T> {
//   data: T
//   code: string
// }

// interface ResData_DataType {
//   data: {
//     tagList: TagType[]
//     bigPromotionModule: {
//       floorList: any[]
//     }
//     // ...
//   }
//   noticeList: any[]
// }

// interface TagType {
//   floorPrice: number
//   picUrl: string
//   newOnShelf: boolean
//   webIndexVerticalPicUrl: string
//   simpleDesc: string
//   name: string
//   appListPicUrl: string
//   id: number
// }
